#pragma once

#include <HSModel/World.h>

#include <functional>

class Ogre::SceneManager;
class Ogre::MeshManager;
class Model3DRenderer;
class World;
class Model3DStorage;

class SceneController
  {
  public:
    SceneController(Ogre::SceneManager* ip_scene_manager, Ogre::MeshManager* ip_mesh_manager, const World& i_world,
                    const Model3DStorage& i_storage);
    
    // create Model3DRenderer for each IRenderable in m_world
    void RenderWorld();
    
    // create Model3DRenderer for each IRenderable in m_world without ground
    void RenderOnlyObjectsInWorld();
   
    // create Model3DRenderer only for ground
    void RenderOnlyGroundInWorld();

    // should be deleted when we can add triangle from application
    Ogre::SceneManager* GetSceneManager();
  private:
    const World& m_world;
    const Model3DStorage& m_storage;

    // not to delete this pointers
    Ogre::SceneManager* mp_scene_manager;
    Ogre::MeshManager* mp_mesh_manager;

    std::map<std::string, std::shared_ptr<Model3DRenderer>> m_renderers;
  };